package com.ruoyi.hqfinance.service.impl;

import com.github.pagehelper.PageHelper;
import com.ruoyi.hqfinance.domain.HqReturnOperateFee;
import com.ruoyi.hqfinance.domain.vo.HqReturnOperateFeeVo;
import com.ruoyi.hqfinance.mapper.HqReturnOperateFeeMapper;
import com.ruoyi.hqfinance.service.HqReturnOperateFeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HqReturnOperateFeeServiceImpl implements HqReturnOperateFeeService {
    @Autowired
    private HqReturnOperateFeeMapper hqReturnOperateFeeMapper;

    @Override
    public List<HqReturnOperateFee> collect(HqReturnOperateFeeVo vo) {
        PageHelper.startPage(vo.getPageDate());
        List<HqReturnOperateFee> returnOperateFees = hqReturnOperateFeeMapper.collect(vo);
        assert returnOperateFees != null;
        for (HqReturnOperateFee hqReturnOperateFee : returnOperateFees){
            if (vo.getTimeType() == 2){
                hqReturnOperateFee.setCollectDate(vo.getStartTime() + "至" + vo.getEndTime());
            }
        }
        return returnOperateFees;
    }
}
